//
//  TRUIFactory.m
//  SafPay
//
//  Created by kaituo on 2018/7/26.
//  Copyright © 2018年 ebo. All rights reserved.
//

#import "TRUIFactory.h"
#define defaultFont FONT(14)
@implementation TRUIFactory
+(instancetype)factory{
    
    return [[self alloc]init];
}
-(UILabel *)createLabelWithText:(NSString *)content Font:(UIFont *)font TextColor:(UIColor *)textColor{
    
    UILabel *label=[[UILabel alloc]init];
    [label setFont:font];
    [label setText:content];
    [label setTextColor:textColor];
    return label;
}
-(UITextField *)createTextFieldWithFont:(UIFont *)font TextColor:(UIColor *)textColor{

    UITextField *textField=[[UITextField alloc]init];
    [textField setFont:font];
    [textField setTextColor:textColor];
    return textField;
}
-(UITextView *)createTextViewWithFont:(UIFont *)font TextColor:(UIColor *)textColor{
    
    UITextView *textView=[[UITextView alloc]init];
    [textView setFont:font];
    [textView setTextColor:textColor];
    return textView;
    
}
-(UIButton *)createBtnWithTitle:(NSString *)title Font:(UIFont *)font TextColor:(UIColor *)textColor BackColor:(UIColor *)backColor Target:(id)target SEL:(SEL)sel {
    
    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    [btn.titleLabel setFont:font];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setBackgroundColor:backColor];
    [btn setTitleColor:textColor forState:UIControlStateNormal];
    if(target!=nil&&sel!=nil){
        
        [btn addTarget:target action:sel forControlEvents:UIControlEventTouchUpInside];
    }
    return btn;
    
}
-(UIImageView *)createImageViewWith:(UIImage *)image{
    
    UIImageView *iv=[[UIImageView alloc]init];
    [iv setImage:image];
    return iv;
}
-(UIView *)createUIView{
    
    UIView *backView=[[UIView alloc]init];
    [backView setBackgroundColor:[UIColor clearColor]];
    return backView;
    
}
-(UITableView *)createTableViewWith:(UIColor *)backCorlor{
    
    UITableView *tableView=[[UITableView alloc]init];
    [tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    [tableView setBackgroundColor:backCorlor];
    return tableView;
    
}

@end
